package org.bugjail.data;

import java.util.List;

public abstract class TestCase {
	private int id;
	private int version;
	private String name;
	private TestCaseType type;
	private int estimatedTime;
	private String objective;
	private int severity;
	private Suite suite;
	private List<Condition> preConditions;
	private List<Condition> postConditions;
	private List<Note> notes;
	private List<Reference> references;
	private int status;
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public int getVersion() {
		return version;
	}
	public void setVersion(int version) {
		this.version = version;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public TestCaseType getType() {
		return type;
	}
	public void setType(TestCaseType type) {
		this.type = type;
	}
	public int getEstimatedTime() {
		return estimatedTime;
	}
	public void setEstimatedTime(int estimatedTime) {
		this.estimatedTime = estimatedTime;
	}
	public String getObjective() {
		return objective;
	}
	public void setObjective(String objective) {
		this.objective = objective;
	}
	public int getSeverity() {
		return severity;
	}
	public void setSeverity(int severity) {
		this.severity = severity;
	}
	public List<Condition> getPreConditions() {
		return preConditions;
	}
	public void setPreConditions(List<Condition> preConditions) {
		this.preConditions = preConditions;
	}
	public List<Condition> getPostConditions() {
		return postConditions;
	}
	public void setPostConditions(List<Condition> postConditions) {
		this.postConditions = postConditions;
	}
	public List<Note> getNotes() {
		return notes;
	}
	public void setNotes(List<Note> notes) {
		this.notes = notes;
	}
	public List<Reference> getReferences() {
		return references;
	}
	public void setReferences(List<Reference> references) {
		this.references = references;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public Suite getSuite() {
		return suite;
	}
	public void setSuite(Suite suite) {
		this.suite = suite;
	}

	public static int STATUS_NEW = 0;
	public static int STATUS_INSPECTION = 1;
	public static int STATUS_OK = 2;
	public static int STATUS_PENDING_APPROVAL = 3;
	public static int STATUS_NOT_APPROVED = 4;
	public static int STATUS_READY = 5;
	public static int STATUS_TESTWARE = 6;
	public static int STATUS_MODIFIED = 7;
	public static int STATUS_INACTIVE = 8;

	public static int SEVERITY_0 = 0;
	public static int SEVERITY_1 = 1;
	public static int SEVERITY_2 = 2;
	public static int SEVERITY_3 = 3;
	public static int SEVERITY_4 = 4;
	
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof TestCase) {
			TestCase tc = (TestCase)obj;
			return this.getId()==tc.getId();
		} else {
			return false;
		}
	}
	
	@Override
	public int hashCode() {
		return getId();
	}
}
